package com.test4.bean;

/**
 * 贼
 *
 * @author Cc
 * 2024-03-12
 */
public class Thief extends People {
    private String toolName;

    {
        this.setName("撬棍");
    }


    @Override
    public void openDoor(Door door) {
        System.out.println("小偷正在开锁....");
        if (door instanceof SecurityDoor || door instanceof IronJadeDoor) {
            if (door instanceof SecurityDoor) {
                ((SecurityDoor) door).Security();
            } else {
                ((IronJadeDoor) door).Security();
            }
        } else {
            door.open();
            System.out.println("发财咯");
        }
    }

    @Override
    public void closeDoor(Door door) {

    }

    @Override
    public String getToolName() {
        return this.toolName;
    }

    @Override
    public void setName(String value) {
        this.toolName = value;
    }

    @Override
    public void open(Door door) {
        openDoor(door);
    }
}
